<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
  <style>
    #group {
      width: 300px;
      height: 300px;
      border: 1px solid red;
    }
  </style>
  <script src="/js/spritejs.js"></script>
</head>
<body>
  <div id="group"></div>
  <script>
;(function () {
  const {Scene, Group, Sprite, Label} = spritejs
  const scene = new Scene('#group', {viewport: ['auto', 'auto'], resolution: [300, 300]})
  const layer = scene.layer('fglayer')
 const group = new Group()
 group.attr({
   anchor: '0.5',
   pos: [150, 150],
   size: [200, 200],
   border: [1, 'blue']
 })
 layer.append(group)
 const image = new Sprite('https://p5.ssl.qhimg.com/t0128a868221afb6a2d.png')
 image.attr({
   anchor: '0.5',
   pos: [100, 85],
   size: [150, 150]
 })

 const label = new Label('发发收发文')
 label.attr({
   anchor: '0.5',
   border: [1, 'yellow'],
   pos: [100, 180],
   textAlign: 'center',
   // size: [200, 30]
 })
 group.append(image, label)
 group.on('click', function(e) {
    image.animate([
   {transform: {rotate: 0}},
   {transform: {rotate: 360}}
 ], {
   duration: 1000,
   iterations: Infinity
 })
 })

}())
  </script>
</body>
</html>